<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {},
    },
    formModel: {
      type: Object,
      default: () => {},
    },
    modelValue: {
      type: String | Number | Array | Boolean | Object,
    },
  },
  data() {
    let self = this;
    return {
      self,
    };
  },
  computed: {
    model: {
      get() {
        return this.modelValue;
      },
      set(value) {
        this.$emit("modelInput", value);
      },
    },
    getPlaceholder() {
      return (text) => {
        return this.item.placeholder || text + this.item.label;
      };
    },
  },
  methods: {
    handleChange() {
      this.$emit("change");
    },
  },
};
</script>